﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EnheimGallery.DAL;
using EnheimGallery.Models.StatisticsModel;

namespace EnheimGallery.Controllers
{
    public class StatisticsController : Controller
    {
        //
        // GET: /Statistics/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult ViewUsersStatistics()
        {
            List<UserStatisticsData> list = UsersStatisticsDAL.UsersStatistics();
            List<UserStatisticsViewModel> viewModel = new List<UserStatisticsViewModel>();
            foreach (UserStatisticsData ustat in list)
            {
                viewModel.Add(new UserStatisticsViewModel(ustat));
            }
            return View(viewModel);
        }

        public ActionResult ViewPhotosStatistics()
        {
            List<PhotoStatsData> list = PhotosStatisticsDAL.PhotosStatistics();
            List<PhotoStatisticsViewModel> viewModel = new List<PhotoStatisticsViewModel>();
            foreach (PhotoStatsData ustat in list)
            {
                viewModel.Add(new PhotoStatisticsViewModel(ustat));
            }
            return View(viewModel);
        }

    }
}
